package com.ittest.mapper.system;

import com.ittest.domain.system.SysLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 日志管理Mapper接口
 */
public interface SysLogMapper {
    // 查询所有
    @Select("select * from syslog order by visitTime desc")
    List<SysLog> findAll();

    // 根据id删除
    // 动态SQL
    void deleteByIds(String[] ids);

    // 记录日志
    @Insert("insert into syslog values(#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    void save(SysLog log);

    // 模糊查询
    List<SysLog> findByTime(String timeStr);
}
